package com.jar.exercise.设计模式.代理.动态代理;


import com.jar.exercise.设计模式.代理.静态代理.ClothFactory;
import com.jar.exercise.设计模式.代理.静态代理.NikeClothfactoy;
import org.junit.Test;

public class Test1 {
	@Test
	public void test1() {
		Chinese chinese = new Chinese();
		Human Human = (com.jar.exercise.设计模式.代理.动态代理.Human) ProxyFactory.getInstance(chinese);
		Human.sayHello();
		String s = Human.country("中国");
		System.out.println(s);
	}

	@Test
	public void test2() {
		NikeClothfactoy clothfactoy = new NikeClothfactoy();
		ClothFactory clothFactory = (ClothFactory) ProxyFactory.getInstance(clothfactoy);
		clothFactory.produceCloth();
	}
}
